home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / INFO / DOSTIPS4.ZIP / DOSPRINT.TXT < prev    next >
Text File  |  1986-06-28  |  9KB  |  233 lines

  1.             Printing the PC's Extended Character Set
  2.             (PC World February 1986 The Help Screen)
  3.  
  4.      GRAPHICS.COM must be run from DOS before Shift-PrtSc can print
  5. subsequent graphics screens.  This does not solve the problem of
  6. printing graphics characters such as the double vertical line and
  7. other similar characters from the PC's extended character set.  These
  8. characters are commonly used as borders around text.  Using Shift-PrtSc
  9. to dump a screen containing these characters to an Epson FX-80 prints
  10. italic capital letters in place of the graphics characters.
  11.      Editor's solution:  You can "teach" the PC to display the PC's
  12. extended character set in graphics mode.  If you're not inclined to
  13. do the necessary programming yourself, you'll need a utility.  Or
  14. consider using GRAFTABL.COM, a utility included with DOS 3.0 and 3.1.
  15.  
  16. -----------------------------------------------------------------
  17.                        Epson Mode Changing
  18.         (PC Magazine Vol 5 No 8 Apr 29, 1986 Power User)
  19.  
  20.      Switching between draft and near-letter-quality (NLQ) modes on
  21. the new Epson LQ-1500 printer is cumbersome.  One way is to go to the
  22. back panel and change the DIP switch settings.  The print mode can be
  23. changed through software, but even that method can be awkward.
  24.      NLQ.COM, created with DEBUG (see below), switches from draft to
  25. NLQ mode.  The program works by using Interrupt 21h, Function 5h, to
  26. send printer control characters to the printer.  Three calls to
  27. Interrupt 21h are needed, one for each byte in the control sequence
  28. (1Bh, 78h, and 01h) required to enable near letter quality on the
  29. LQ-1500.
  30.      A similar command could be written for a different printer by
  31. using different printer control codes.
  32.  
  33. A>debug
  34. -a
  35. xxxx:0100 MOV DL,1B
  36. xxxx:0102 MOV AH,05
  37. xxxx:0104 INT 21
  38. xxxx:0106 MOV DL,78
  39. xxxx:0108 MOV AH,05
  40. xxxx:010A INT 21
  41. xxxx:010C MOV DL,01
  42. xxxx:010E MOV AH,05
  43. xxxx:0110 INT 21
  44. xxxx:0112 INT 20
  45. xxxx:0114
  46. -R CX
  47. :14
  48. -N NLQ.COM
  49. -W
  50. Writing 014 bytes
  51. -Q
  52.  
  53.  
  54.  
  55.  
  56.                       More on Mode Changes
  57.         (PC Magazine Vol 5 No 8 Apr 29, 1986 Power User)
  58.  
  59.      The DOS MODE command lets you configure options for the
  60. asynchronous communications adapter, the display, and the printer.
  61. For example, you can use it to set a printer into condensed (132-
  62. column) mode, but you usually have to refer to the DOS manual to be
  63. sure you have all the MODE options entered correctly.  It would also
  64. be nice to have MODE set the printer into enhanced (darkened) mode
  65. printing.
  66.      DARK.COM sets the printer to the "enhanced" mode of printing.
  67. SMALL.COM sets up the printer to print in condensed mode.  Both can
  68. be created with DEBUG:
  69.  
  70. A>debug
  71. -n dark.com
  72. -a
  73. xxxx:0100 MOV DL,1b
  74. xxxx:0102 MOV AH,05
  75. xxxx:0104 INT 21
  76. xxxx:0106 MOV DL,45
  77. xxxx:0108 MOV AH,05
  78. xxxx:010A INT 21
  79. xxxx:010C INT 20
  80. xxxx:010E
  81. -r cx
  82. CX 0000
  83. :e
  84. -w
  85. Writing 000E bytes
  86. -q
  87.  
  88. A>debug
  89. -a
  90. xxxx:0100 MOV DL,0F
  91. xxxx:0102 MOV AH,05
  92. xxxx:0104 INT 21
  93. xxxx:0106 INT 20
  94. xxxx:0108
  95. -r cx
  96. CX 0000
  97. :8
  98. -n small.com
  99. -w
  100. Writing 0008 bytes
  101. -q
  102.  
  103. Editor's Note:  Many small printer-control .COM programs are useful --
  104. for a particular situation.  You must be careful in using or modifying
  105. such programs, however.  For example, in "Epson Mode Changing" above,
  106. NLQ.COM works only with IBM- or Epson-compatible dot matrix printers.
  107. Most other printers use a 2- or 3-byte code for condensed print, unlike
  108. the IBM/Epson design, which uses only one.
  109.      If your printer has a lot of options (and associated control codes)
  110. that you use less frequently, a more general program can be very useful.
  111. Such a program would accept the printer control codes as data and send
  112. them to the printer right from the DOS prompt.  PSET.COM takes in the
  113. decimal ASCII codes as part of the command line and sends them to your
  114. printer.  PSET is slightly more complex and somewhat larger than
  115. single-purpose printer control programs.  Its job is to scan the
  116. command line, looking for numeric characters that represent decimal
  117. ASCII codes.  (Be careful when you use it, since it does not check
  118. for non-numeric characters -- if you enter them, you may get strange
  119. results on your printer.)
  120.      As PSET finds each code (separated by blanks), it converts it to
  121. binary (internal) representation and pushes it on the stack.  When the
  122. scan is done, the codes are popped off the stack and sent to the
  123. printer using Function 5h of DOS Interrupt 21h.  A value of 1234h is
  124. pushed onto the stack at the beginning of the program for use as an
  125. "end-of-stack" indicator.  Since PSET scans from the end of the command
  126. line to the beginning, the control codes will be sent to the printer in
  127. the correct order when they are popped off the stack.
  128.  
  129. 100 'PSET.BAS:  Program to create PSET.COM.  From PC Magazine Vol 5
  130. 101 'No 8 April 29, 1986 Power User by Craig L. Stark.
  131. 110 CLS:PRINT "Checking DATA statements ..."
  132. 120 FOR B=1 TO 5
  133. 130 FOR C=1 TO 17
  134. 140 READ A$:IF C<17 THEN 160
  135. 150 Z#=Z#+VAL(A$)
  136. 160 NEXT:NEXT
  137. 170 IF Z#=8979 THEN RESTORE:GOTO 200
  138. 180 PRINT "Error: Check the last number in"
  139. 190 PRINT "each DATA statement; then redo."
  140. 200 FOR B=1 TO 5
  141. 210 FOR C=1 TO 16
  142. 220 READ A$:TTL=TTL+VAL("&H"+A$)
  143. 230 NEXT
  144. 240 READ S:IF S=TTL THEN 270
  145. 250 PRINT "DATA error in line ";B*10+330:END
  146. 270 TTL=0:NEXT:RESTORE
  147. 280 OPEN "PSET.COM" AS #1 LEN=1:FIELD #1,1 AS D$
  148. 290 FOR B=1 TO 5
  149. 300 FOR C=1 TO 16
  150. 310 READ A$:LSET D$=CHR$(VAL("&H"+A$))
  151. 320 PUT #1:NEXT:READ DUMMY$:NEXT:CLOSE
  152. 330 PRINT "PSET.COM created."
  153. 340 DATA BE,80,00,FC,AC,98,8B,C8,49,03,F1,FD,BA,34,12,E8,2291
  154. 350 DATA 2C,00,AC,3C,20,75,05,E8,24,00,E2,F6,2C,30,F6,E3,1735
  155. 360 DATA 02,D0,8A,C3,B3,0A,F6,E3,8A,D8,E2,E6,E8,0F,00,5A,2352
  156. 370 DATA 81,FA,34,12,74,06,B4,05,CD,21,EB,F3,CD,20,5B,52,1882
  157. 380 DATA 53,B3,01,33,D2,C3,00,00,00,00,00,00,00,00,00,00,719
  158.  
  159.      The easiest test for PSET.COM is to have it print a few ordinary
  160. characters (the program doesn't care that they're not control codes)
  161. and then issue a form feed to bring in a new page of paper.  Try this:
  162.  
  163. A>pset 80 67 32 77 97 103 97 122 105 110 101 13 12
  164.  
  165.  
  166. Once you've got this working, you can issue any printer control codes
  167. you want.  For example, the following does the same thing as NLQ.COM:
  168.  
  169. A>pset 27 120 1
  170.  
  171. If you find that you use the same PSET command frequently, you could
  172. put it in a .BAT and continue to use PSET.
  173.  
  174. -----------------------------------------------------------------
  175.                           PrtSc Feeding
  176.        (PC Magazine Vol 5 No 10 May 27, 1986 User-to-User)
  177.  
  178.      The problem with doing a series of print screens is that every
  179. time one finishes you normally have to take the printer off-line, hit
  180. the form-feed button, then put the printer back on-line.  PRTSCRFF.COM
  181. does that for you.  Run PRTSCRFF.COM when you boot your computer, and
  182. all subsequent Shift-PrtSc's will be followed automatically by a form
  183. feed.  PRTSCRFF simply calls the original BIOS print-screen routine
  184. (Interrupt 05h) and follows it up by sending a form feed to the
  185. printer.  This is especially useful for the HP LaserJet printer.  The
  186. LaserJet's standard print screen is held in a buffer until you take
  187. the printer off-line and press the form-feed button.  With PRTSCRFF
  188. the page is automatically printed and fed through the system.
  189.      Editor's Note:  Since screens are 25 lines deep and printed pages
  190. a little more than twice that, if you don't have too many to print it's
  191. sometimes handy to run off two screens per page.
  192.  
  193. 100 'PRTSCRFF.BAS
  194. 110 OPEN "PRTSCRFF.COM" AS #1 LEN=1:FIELD #1,1 AS D$
  195. 120 FOR A=1 TO 77:READ a$:LSET D$=CHR$(VAL("&H"+A$))
  196. 130 PUT #1:NEXT:CLOSE:PRINT "PRTSCRFF.COM created.":END
  197. 140 DATA EB,21,90,00,00,00,00,FB,1E,52,53,50,8C,CB,8E,DB
  198. 150 DATA 9C,2E,FF,1E,03,01,BA,00,00,B8,0C,00,CD,17,58,5B
  199. 160 DATA 5A,1F,CF,8C,CB,8E,DB,B0,05,B4,35,CD,21,2E,89,1E
  200. 170 DATA 03,01,2E,8C,06,05,01,8C,CB,8E,DB,BA,07,01,B0,05
  201. 180 DATA B4,25,CD,21,8C,CB,8E,DB,BA,23,01,CD,27
  202.  
  203. -----------------------------------------------------------------
  204.                      Tackling a Switch Back
  205.                (PC World May 1986 The Help Screen)
  206.  
  207.      If you have two printers and two parallel ports, SWAPLPTS.COM is
  208. a useful program for switching back and forth between printers.  It
  209. merely swaps the port address values for LPT1 and LPT2.  Running the
  210. program once causes output to be directed to LPT2; running it a second
  211. time causes output to be directed to LPT1.
  212.      To create SWAPLPTS.COM, place a copy of DEBUG.COM in drive B: and
  213. a disk for saving the program in drive A:.  At the A> prompt, enter:
  214.  
  215. A>B:DEBUG
  216. -A
  217. xxxx:0100 MOV AX,40
  218. xxxx:0103 MOV DS,AX
  219. xxxx:0105 MOV BX,[8]
  220. xxxx:0109 MOV CX,[A]
  221. xxxx:010D MOV [8],CX
  222. xxxx:0111 MOV [A],BX
  223. xxxx:0115 INT 20
  224. xxxx:0117
  225. -R CX
  226. CX 0000
  227. :17
  228. -N A:SWAPLPTS.COM
  229. -W
  230. Writing 17 bytes
  231. -Q
  232.  
  233.